// 使用示例
tongchengyou_login();

function tongchengyou_login(){
    var queryParams = getQueryParams();

    queryParams.cid = cid;
    queryParams.gid = gid;
    faXingLogin(queryParams);
}

function getQueryParams() {
    var urlParams = new URLSearchParams(window.location.search);
    var params = {};
    for (var param of urlParams.entries()) {
        params[param[0]] = param[1];
    }
    return params;
}



function tongchengyou_creterole(data){

    if(data.is_save == 1){

        var roleParams = {
            cpgameid: 'cpgameid',
            qqesuid: 'qqesuid',
            channelid: 'channelid',
            cpguid: 'cpguid',
            rolename: 'rolename',
            serverid: 'serverid',
            level: 'level'
        };
        // 进入游戏
        SbPulSdk.createRole(roleParams);

    }else{

        var roleParams = {
            cpgameid: 'cpgameid',
            qqesuid: 'qqesuid',
            channelid: 'channelid',
            cpguid: 'cpguid',
            rolename: 'rolename',
            serverid: 'serverid',
            level: 'level',
            servername: 'servername',
            vip: 'vip'
        };
        // 进入游戏
        SbPulSdk.loginRole(roleParams);

    }
}



function tongchengyou_pay(data){
    console.log("tongchengyou：",data);

    //iframe 层
    layer.open({
        type: 2,
        title: '充值页面',
        shadeClose: true,
        shade: 0.8,
        area: ['622PX', '402px'],
        content: data //iframe的url
    });
}
